<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : da_100_02E.jsp
    Description : 공지/이벤트 상세 화면 (영문)
    author Seung Won
    since 2012. 8. 9.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 8. 9.     Seung Won     최초 생성
--%>

<%@ include file="/WEB-INF/jsp/co/us/include/declare.jspf" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Notice&Event &#124; HMC CSR</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<%@ include file="/WEB-INF/jsp/co/us/include/header.jspf" %>
<link rel="stylesheet" type="text/css" href="/css/usr/eng.css" media="screen" />
<script type="text/javaScript" language="javascript">
<!--
$(document).ready(function() {
    /* form validation check */
    onloadCharCheck();
    
    $("#listButn").bind("click", moveListPage);    // 리스트페이지 이동
    $("#rgstButn").bind("click", moveRgstPage);    // 등록페이지 이동
    $("#confButn").bind("click", moveConfirm);    // 등록페이지 이동
});

/*
 * 리스트페이지 이동
 */
function moveListPage() {
    $("#mainForm").attr('target','_self');
    $("#mainForm").attr('action','/da_100_01.do').submit();
}

/*
 * 등록페이지 이동
 */
function moveRgstPage(argEvntScnCd) {
    
    var win = window.open("","pop", "scrollbars=yes, width=900,height=500");

    $("#mainForm").attr('target','pop');  
    
    if (argEvntScnCd == '01') {
        $("#mainForm").attr('action','/da_100_04.do').submit();
    } else if (argEvntScnCd == '02') {
        $("#mainForm").attr('action','/da_100_08.do').submit();
    } else if (argEvntScnCd == '03') {
        $("#mainForm").attr('action','/da_100_12.do').submit();
    }
    
    
}

/*
 * 이전, 다음  게시글 이동
 */
function moveNxtPage(argIdx, argBlbCd) {
    
    $("#idx").val(argIdx);
    $("#blbCd").val(argBlbCd);
    
    $("#mainForm").attr('target','_self');   
    $("#mainForm").attr('action','/da_100_02.do').submit();
    
}

/*
 * 수정 레이어 컨펌
 */
function moveConfirm() {
    if (!validateForm($("#subForm"))) {
        return;
    }
    
    $("#subForm").attr('target','comIframe');   
    $("#subForm").attr('action','/da_100_03.do').submit();
    
}


/*
 * 스크립트 Split
 */
function stringSplit(strData, strIndex){ 
    var stringList = new Array();
    
    while(strData.indexOf(strIndex) != -1) {
        stringList[stringList.length] = strData.substring(0, strData.indexOf(strIndex)); 
        strData = strData.substring(strData.indexOf(strIndex)+(strIndex.length), strData.length); 
    }
    
    stringList[stringList.length] = strData; 
    return stringList; 
   }


/*
 * 페이스북 Share 링크
 */
function goFaceBook(title, link) {
    var arrLink = stringSplit(link, "?");
     
    var fullUrl;     
    var url = arrLink[0]+"?blbkey="+$("#idx").val()+"k"+$("#blbCd").val();
    var title = title;     
    var summary = "${fn:replace(result.titl, '"', '')}";
    var pWidth = 640;     
    var pHeight = 380; 
    var pLeft = (screen.width - pWidth) / 2;     
    var pTop = (screen.height - pHeight) / 2;       
    fullUrl = "http://www.facebook.com/share.php?s=100&p[url]="+ url                 
    //+"&p[images][0]="+ image                 
    +"&p[title]="+ title                 
    +"&p[summary]="+ summary;     
    
    fullUrl = fullUrl.split("#").join("%23");     
    fullUrl = encodeURI(fullUrl);    
    
    window.open(fullUrl, "facebook", "width="+ pWidth +",height="+ pHeight +",left="+ pLeft +",top="+ pTop +",location=no,menubar=no,status=no,scrollbars=no,resizable=no,titlebar=no,toolbar=no"); 
}

/*
 * 트위터 Share 링크
 */
function goTwitter(title, link) {
    var pWidth = 640;     
    var pHeight = 380; 
    var pLeft = (screen.width - pWidth) / 2;     
    var pTop = (screen.height - pHeight) / 2;       
    
    var href = "http://twitter.com/intent/tweet?text=" + encodeURIComponent(title) + " " + encodeURIComponent(link);
    var a = window.open(href, 'twitter', "width="+ pWidth +",height="+ pHeight +",left="+ pLeft +",top="+ pTop +",location=no,menubar=no,status=no,scrollbars=no,resizable=no,titlebar=no,toolbar=no");
    if(a) { a.focus(); }
}
//-->
</script>
</head>
<body>
<div id="wrap">
    <!-- top -->
    <%@ include file="/WEB-INF/jsp/co/us/include/topE.jsp" %>
    <!-- top -->
 
    <!-- container -->
    <div id="container">
        <div id="contentsWrap">
            <div id="contentsArea">
                <div class="headingArea">
                    <h2>NOTICE &amp; EVENT</h2>
                </div>
                <div id="contetns">
                    <div class="location">
                        <a href="/ma_100_01.do">Home</a>
                        <a href="/da_100_01.do">CSR Materials</a>
                        <span>Notice &amp; Event</span>
                    </div>

                    <div class="snsArea">
                        <a href="javascript:goFaceBook('CSR/Materials - CSR Notice/Event', location.href);"><img src="/img/usr/eng/common/facebook.gif" alt="Share on Facebook" /></a>
                        <a href="javascript:goTwitter('CSR/Materials - CSR Notice/Event', location.href);"><img src="/img/usr/eng/common/tweeter.gif" alt="Share on Twitter" /></a>
                    </div>
                    <form id="mainForm" name="mainForm" method="post">
                        <input type="hidden" id="idx" name="idx" value="${rqInfo.idx }" />
                        <input type="hidden" id="blbCd" name="blbCd" value="${rqInfo.blbCd }" />
                        <input type="hidden" id="currentPageNo" name="currentPageNo" value="${rqInfo.currentPageNo}" />
                        <input type="hidden" id="srchScn" name="srchScn" value="${rqInfo.srchScn}" />
                        <input type="hidden" id="srchBlbCd" name="srchBlbCd" value="${rqInfo.srchBlbCd}" />
                        <input type="hidden" id="srchTxt" name="srchTxt" value="${rqInfo.srchTxt}" />
                        <input type="hidden" id="CSR_LOCALE_PARAM" name="CSR_LOCALE_PARAM" value="en" />
                    </form>
                    <table border="1" class="tableData" summary="Information Type, Date Updated, View Count, Subject, Attachments">
                        <col width="20%" />
                        <col width="30%" />
                        <col width="20%" />
                        <col width="30%" />
                        <tbody>
                            <tr>
                                <td class="subThead">Information Type</td>
                                <td colspan="3"><c:if test="${rqInfo.blbCd == '1'}">NOTICE</c:if><c:if test="${rqInfo.blbCd == '2'}">EVENT</c:if></td>
                            </tr>
                            <tr>
                                <td class="subThead">Date Updated</td>
                                <td class="num">${result.rgstDt }</td>
                                <td class="subThead depth">View Count</td>
                                <td class="num">${result.iqNo }</td>
                            </tr>
                            <tr>
                                <td class="subThead">Subject</td>
                                <td colspan="3">${result.titl }</td>
                            </tr>
                            <tr>
                                <td class="subThead">Attachments</td>
                                <td colspan="3"><c:if test="${rqInfo.blbCd == '1'}">
                                    <a href="#" onclick="getUpFileDownload('0050','${result.idx}');return false;">${result.filNm }</a>
                                    </c:if>
                                    <c:if test="${rqInfo.blbCd == '2'}">
                                    <a href="#" onclick="getUpFileDownload('0200','${result.evntIdx}');return false;">${result.filNm }</a>
                                    </c:if>
                                 </td>
                            </tr>
                            <tr>
                                <td colspan="4" class="dataView">
                                    <div class="viewArea">
                                        <p>${result.sbc } </p>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="subThead">Next</td>
                                <td colspan="3">
                                    <c:if test="${result.preIdx == null ||  result.preIdx == ''}">
                                    There is no Next post.
                                    </c:if>                                                            
                                    <c:if test="${result.preIdx != null &&  result.preIdx != ''}">
                                    <a href="javascript:moveNxtPage('${result.preIdx }','${result.preBlbCd }');">${result.preTitl }</a>
                                    </c:if>                                                          
                                </td>
                            </tr>
                            <tr>
                                <td class="subThead">Previous</td>
                                <td colspan="3">
                                    <c:if test="${result.nxtIdx == null ||  result.nxtIdx == ''}">
                                    There is no Previous post.
                                    </c:if>                                                            
                                    <c:if test="${result.nxtIdx != null &&  result.nxtIdx != ''}">
                                    <a href="javascript:moveNxtPage('${result.nxtIdx }','${result.nxtBlbCd }');">${result.nxtTitl }</a>
                                    </c:if>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="btnArea down">
                        <span class="reverse"><a href="#"><img id="listButn" src="/img/usr/eng/btn/btn_list.gif" alt="list" /></a></span>
                    </div>
                    <div class="pageNate">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /container -->
 
    <!-- footer -->
    <%@ include file="/WEB-INF/jsp/co/us/include/bottomE.jsp" %>
    <!-- /footer -->
</div>
</body>
</html>